home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
014a
/
vgakit34.zip
/
POINT.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-05-04
|
1KB
|
84 lines
include model.h
;
; VGAKIT Version 3.4
;
; Copyright 1988,89,90 John Bridges
; Free for use in commercial, shareware or freeware applications
;
; POINT.ASM
;
;
.data
extrn curbk:word
extrn maxx:word,maxy:word
.code
extrn newbank:proc
public point
public point13x
point proc xpos:word,ypos:word,color:word
mov bx,[xpos]
mov ax,[ypos]
mov dx,[maxx]
cmp bx,0
jl nope1
cmp bx,dx
jge nope1
cmp ax,0
jl nope1
cmp ax,[maxy]
jge nope1
mul dx ;640 dots wide in most cases
add bx,ax
adc dx,0
mov ax,dx
cmp ax,[curbk]
jz nonew
call newbank ;switch banks if a new bank entered
nonew: mov ax,0a000h ;setup screen segment A000
mov es,ax
mov al,byte ptr [color] ;get color of pixel to plot
mov es:[bx],al
nope1: ret
point endp
point13x proc xpos:word,ypos:word,color:word
mov bx,[xpos]
mov ax,[ypos]
mov dx,[maxx]
cmp bx,0
jl nope2
cmp bx,dx
jge nope2
cmp ax,0
jl nope2
cmp ax,[maxy]
jge nope2
shr dx,1
shr dx,1
mul dx ;360 dots wide (for 360x480 mode)
mov cx,bx
shr bx,1
shr bx,1
add bx,ax
mov ax,102h
and cl,3
shl ah,cl ;create bit plane mask
mov dx,3c4h
out dx,ax ;set EGA bit plane mask register
mov ax,0a000h ;setup screen segment A000
mov es,ax
mov al,byte ptr [color] ;get color of pixel to plot
mov es:[bx],al
nope2: ret
point13x endp
end